//统一管理接口
import requests from './request';
import mockRequests from './mockAjax';
export const reCategoryList = () => { 
    return requests({ method:'get', url: '/product/getBaseCategoryList'})
}

export const reBannerList = () =>  mockRequests.get('/banner')
//获取floor数

export const reqFloorList=()=> mockRequests.get('/floor')
//获取搜索模块数据,需要传参
//当前此接口（获取搜索模块数据），给服务器传递的至少是一个空对象（调用时：reqGetSearchInfo（{}））
export const reqGetSearchInfo = (params) => requests({ method:'post', url:'/list', data:params})


//获取产品详情信息接口
export const reqGoodsInfo = (skuId) => requests({ method:'get', url:`/item/${skuId}`})
//将产品添加到购物车
export const reqAddOrUpdateShopCart = (skuId,skuNum) => requests({ method:'post', url:`/cart/addToCart/${skuId}/${skuNum}`})
//获取购物车列表数据
export const reqCartList = () => requests({ method:'get', url:'/cart/cartList'})
//删除购物车商品
export const reqDeleteCartById = (skuId) => requests({ method:'delete', url:`/cart/deleteCart/${skuId}`})
//修改商品选中状态
export const reqUpdateCheckedById = (skuId,isChecked) => requests({ method:'get', url:`/cart/checkCart/${skuId}/${isChecked}`})
//获取验证码
export const reqGetCode = (phone) => requests({ method:'get', url:`/user/passport/sendCode/${phone}`}) 
//用户注册
export const reqUserRegister = (data) => requests({ method:'post', url:'/user/passport/register', data})
//用户登录
export const reqUserLogin = (data) => requests({ method:'post', url:'/user/passport/login', data})
//获取用户信息
export const reqUserInfo = () => requests({ method:'get', url:'/user/passport/auth/getUserInfo'})
//退出登录
export const reqLogout = () => requests({ method:'get', url:'/user/passport/logout'})
//获取用户地址信息
export const reqAddressInfo = () => requests({ method:'get', url:'/user/userAddress/auth/findUserAddressList'})
//获取商品清单
export const reqOrderInfo = () => requests({ method:'get', url:'/order/auth/trade'})
//提交订单
export const reqSubmitOrder = (tradeNo,data) => requests({ method:'post', url:`/order/auth/submitOrder?tradeNo=${tradeNo}`, data})

//获取订单支付信息
export const reqPayInfo = (orderId) => requests({ method:'get', url:`/payment/weixin/createNative/${orderId}`})
//获取订单支付状态
export const reqPayStatus = (orderId) => requests({ method:'get', url:`/payment/weixin/queryPayStatus/${orderId}`})

//获取个人中心数据
export const reqMyOrderList = (page,limit) => requests({ method:'get', url:`/order/auth/${page}/${limit}`})








